<template>
    <h1>详情页</h1>
    {{ $route.params.id }}  --{{ id }}
    <div v-if="productDetail">
        {{ productDetail.id }}
    </div>
</template>
<script setup>
import { useRoute } from 'vue-router';
import {useProductDetail} from '@/hooks/products'
const route = useRoute();
const id = route.params.id;
const {data:productDetail,loading} = useProductDetail(id);

</script>